package com.zzy.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzy.system.domain.PurchaseOrderDetail;
import com.zzy.system.domain.SaleOrderCustomer;
import com.zzy.system.mapper.PurchaseOrderDetailMapper;
import com.zzy.system.mapper.SaleOrderCustomerMapper;
import com.zzy.system.service.IPurchaseOrderDetailService;
import com.zzy.system.service.ISaleOrderCustomerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class SaleOrderCustomerServiceImpl extends ServiceImpl<SaleOrderCustomerMapper, SaleOrderCustomer> implements ISaleOrderCustomerService {
    private static final Logger log = LoggerFactory.getLogger(SaleOrderCustomerServiceImpl.class);

    @Override
    public void saveOrderCustomer(SaleOrderCustomer saleOrderCustomer) {
        QueryWrapper<SaleOrderCustomer> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("order_id", saleOrderCustomer.getOrderId());
        baseMapper.delete(queryWrapper);
        this.save(saleOrderCustomer);
    }
}